// songrenderer.h

// 2008-05-01 18:33:37 (Jake): created

#ifndef songrenderer_h
#define songrenderer_h

#include "song.h"

class Game;

class SongRenderer : public osg::Referenced {
public:
	SongRenderer(Game* game);

//	void setSongAndLevel(Song* song, int level);

	osg::Node* renderNotes();
	osg::Node* renderBars();

	Game* getGame() { return _game.get(); }

protected:
	osg::Node* renderNote(const SongNote& note);

	osg::observer_ptr<Game> _game;
//	osg::ref_ptr<Song> _song;
	osg::ref_ptr<osg::Group> _notesNode;
	osg::ref_ptr<osg::Group> _barsNode;
	float _bandSize;
	float _timeSize;
};

class SongRendererUpdater : public osg::NodeCallback {
public:
	SongRendererUpdater(SongRenderer* songRenderer);

	void operator()(osg::Node* node, osg::NodeVisitor* nv);

protected:
	osg::observer_ptr<SongRenderer> _songRenderer;
};

#endif